package pkev.xgrapher.component.models;

import pkev.xgrapher.Constants;
import pkev.xgrapher.common.entity.XFlowGraphics;

import java.awt.*;

public class Caption extends AbstractGrapherModel{

    @Override
    public void draw(XFlowGraphics g) {
        g.getG().setColor(new Color(109, 156, 135));

        for (int i = Constants.AXIS_DELTA; i < Constants.MAX_X; i += Constants.AXIS_DELTA) {
            g.drawString(String.valueOf(i), i - 1, -5);
        }

        for (int i = -Constants.AXIS_DELTA; i > Constants.MIN_X; i -= Constants.AXIS_DELTA) {
            g.drawString(String.valueOf(i), i - 1, -5);
        }

        for (int i = Constants.AXIS_DELTA; i < Constants.MAX_Y; i += Constants.AXIS_DELTA) {
            g.drawString(String.valueOf(i), 2, i - 1);
        }

        for (int i = -Constants.AXIS_DELTA; i > Constants.MIN_Y; i -= Constants.AXIS_DELTA) {
            g.drawString(String.valueOf(i), 2, i - 1);
        }
    }

    @Override
    public int getLayoutIndex() {
        return 0;
    }
}
